package com.kevin.spring.jdbc;

import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserTest {

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@Test
	public void testUser() {

		ApplicationContext ctx = new ClassPathXmlApplicationContext(
				"/com/kevin/spring/jdbc/ApplicationContext.xml");

		UserDao userDao = ctx.getBean("userDaoImp", UserDaoImp.class);

		User user = new User();
		user.setName("kevin");
		user.setAge(30);

		userDao.save(user);
	}
}
